package com.scsj.supermarket.view.activity.customerservicemodel;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.scsj.supermarket.R;
import com.scsj.supermarket.view.activity.baseactivitymodel.BaseActivity;

public class SurveyFeedbackActivity extends BaseActivity implements View.OnClickListener {
    private LinearLayout questionOneLL;
    private LinearLayout questionTwoLL;
    private LinearLayout questionThreeLL;

    private ImageView questionOneIv, questionTwoIv, questionThreeIv;


    @Override
    protected void createView(Bundle savedInstanceState) {
        setContentView(R.layout.activity_survey_feedback);
        initView();
        initData();
        initListener();
    }

    @Override
    protected void initView() {
        questionOneLL = findViewById(R.id.question_one);
        questionTwoLL = findViewById(R.id.question_two);
        questionThreeLL = findViewById(R.id.question_three);

        questionOneIv = findViewById(R.id.question_one_iv);
        questionTwoIv = findViewById(R.id.question_two_iv);
        questionThreeIv = findViewById(R.id.question_three_iv);

    }

    @Override
    protected void initListener() {
        questionOneLL.setOnClickListener(this);
        questionTwoLL.setOnClickListener(this);
        questionThreeLL.setOnClickListener(this);

    }

    @Override
    protected void initData() {

    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.question_one:
                questionOneIv.setBackgroundResource(R.mipmap.check_select);
                questionTwoIv.setBackgroundResource(R.mipmap.check_no_select);
                questionThreeIv.setBackgroundResource(R.mipmap.check_no_select);
                break;
            case R.id.question_two:
                questionOneIv.setBackgroundResource(R.mipmap.check_no_select);
                questionTwoIv.setBackgroundResource(R.mipmap.check_select);
                questionThreeIv.setBackgroundResource(R.mipmap.check_no_select);
                break;
            case R.id.question_three:
                questionOneIv.setBackgroundResource(R.mipmap.check_no_select);
                questionTwoIv.setBackgroundResource(R.mipmap.check_no_select);
                questionThreeIv.setBackgroundResource(R.mipmap.check_select);
                break;

        }

    }
}
